<template>
    <title-box title="交流信息">
        <div class="x-content-inner">
            <!-- 指标小号形式，追加 mini -->
            <ul class="x-target-list mini columns-3">
                <li>
                    <h4 class="x-target-title">A相</h4>
                    <div class="x-target-content">
                        <span>{{ toFixed(props.devicesDayPower.av) }}V / {{ toFixed(props.devicesDayPower.ai) }}A</span>
                    </div>
                </li>
                <li>
                    <h4 class="x-target-title">B相</h4>
                    <div class="x-target-content">
                        <span>{{ toFixed(props.devicesDayPower.bv) }}V / {{ toFixed(props.devicesDayPower.bi) }}A</span>
                    </div>
                </li>
                <li>
                    <h4 class="x-target-title">C相</h4>
                    <div class="x-target-content">
                        <span>{{ toFixed(props.devicesDayPower.cv) }}V / {{ toFixed(props.devicesDayPower.ci) }}A</span>
                    </div>
                </li>
                <li>
                    <h4 class="x-target-title">频率</h4>
                    <div class="x-target-content">
                        <span>{{ toFixed(props.devicesDayPower.if) }}Hz</span>
                    </div>
                </li>
                <li>
                    <h4 class="x-target-title">功率</h4>
                    <div class="x-target-content">
                        <span>{{ toFixed(props.devicesDayPower.p) }}kW</span>
                    </div>
                </li>
                <li>
                    <h4 class="x-target-title">温度(IGBT)</h4>
                    <div class="x-target-content">
                        <span>{{ toFixed(props.devicesDayPower.t) }}℃</span>
                    </div>
                </li>
            </ul>
        </div>
    </title-box>
</template>
<script setup>
import TitleBox from '/@/components/TitleBox/index.vue'
import { computed } from 'vue'

const props = defineProps({
    devicesDayPower: {
        type: Object,
        default: () => {
            return {}
        }
    }
})

const toFixed = computed(() => {
    return power => {
        return power ? power.toFixed(2) : '0.00'
    }
})
</script>
